﻿Imports System.ComponentModel

<DefaultEvent("T3_Click")>
Public Class UserPanel


    Property ImagePath As String = String.Empty


    <Description("显示路径")>
    Public Property T3_Font_Path() As String
        Get
            Return ImagePath
        End Get
        Set
            ImagePath = Value
        End Set
    End Property


    <Description("显示文本")>
    Public Property T3_Font_Text() As String
        Get
            Return UserCheck.Text
        End Get
        Set
            UserCheck.Text = Value
        End Set
    End Property


    <Description("是否选中")>
    Public Property T3_User_Check() As Boolean
        Get
            Return UserCheck.Checked
        End Get
        Set
            UserCheck.Checked = Value
        End Set
    End Property


    <Description("背景图片")>
    Public Property T3_User_Image() As Image
        Get
            Return ImageBox.BackgroundImage
        End Get
        Set
            ImageBox.BackgroundImage = Value
        End Set
    End Property


    Private Sub UserLabel_MouseEnter(sender As Object, e As EventArgs) Handles Me.MouseEnter, ImageBox.MouseEnter
        BackColor = ColorTranslator.FromHtml("#ff5555")
    End Sub

    Private Sub UserLabel_MouseLeave(sender As Object, e As EventArgs) Handles Me.MouseLeave, ImageBox.MouseLeave
        BackColor = ColorTranslator.FromHtml("#ffffff")
    End Sub




    '// 定义触发关闭点击事件
    Shadows Event T3_Click As EventHandler
    Private Sub ImageBox_Click(sender As Object, e As EventArgs) Handles ImageBox.Click
        RaiseEvent T3_Click(Me, e)
    End Sub


End Class
